package com.rc.saas.tenant.config;

import com.rc.saas.tenant.common.constant.ShiroConstants;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * Created by sven on 2018-03-17
 */
@Configuration
public class UpYunConfig {
    @Value("${upyun.bucketName}")
    private String bucketName;

    @Value("${upyun.userName}")
    private String userName;

    @Value("${upyun.password}")
    private String password;

    @Value("${upyun.upload.image.path}")
    private String uploadImagePath;


    @Value("${upyun.upload.enterprise.path}")
    private String uploadEnterprisePath;
    //
    @Value("${upyun.upload.personal.path}")
    private String uploadPersonalPath;

    @Value("${upyun.upload.tenantOperatorAcctContract.path}")
    private String uploadAcctContractPath;

    @Value("${upyun.upload.tenantOperatorInvoice.path}")
    private String uploadOperatorInvoicePath;
    //
    //@Value("${upyun.upload.shop.path}")
    //private String uploadShopPath;
    //
    //@Value("${upyun.upload.erp.path}")
    //private String uploadErpPath;

    @Value("${upyun.download.root}")
    private String downloadRoot;

    //public UpYunConfig() {
    //    Session session = SecurityUtils.getSubject().getSession();
    //    TenantUser user = (TenantUser) session.getAttribute(ShiroConstants.SESSION_TENANT_USER_KEY);
    //    this.tenantCode = user.getTenantCode();
    //    this.tenantOperatorCode = user.getTenantOperatorCode();
    //}


    public String getUploadEnterprisePath() {
        return uploadEnterprisePath;
    }

    public void setUploadEnterprisePath(String uploadEnterprisePath) {
        this.uploadEnterprisePath = uploadEnterprisePath;
    }

    public String getBucketName() {
        return bucketName;
    }

    public void setBucketName(String bucketName) {
        this.bucketName = bucketName;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUploadImagePath() {
        return uploadImagePath;
    }

    public void setUploadImagePath(String uploadImagePath) {
        this.uploadImagePath = uploadImagePath;
    }

    //public String getUploadEnterpricePath() {
    //    return uploadEnterpricePath;
    //}
    //
    //public void setUploadEnterpricePath(String uploadEnterpricePath) {
    //    this.uploadEnterpricePath = uploadEnterpricePath;
    //}

    public String getUploadPersonalPath() {
        return uploadPersonalPath;
    }

    public void setUploadPersonalPath(String uploadPersonalPath) {
        this.uploadPersonalPath = uploadPersonalPath;
    }

    //public String getUploadShopPath() {
    //    return uploadShopPath;
    //}
    //
    //public void setUploadShopPath(String uploadShopPath) {
    //    this.uploadShopPath = uploadShopPath;
    //}
    //
    //public String getUploadErpPath() {
    //    return uploadErpPath;
    //}
    //
    //public void setUploadErpPath(String uploadErpPath) {
    //    this.uploadErpPath = uploadErpPath;
    //}

    public String getDownloadRoot() {
        return downloadRoot;
    }

    public void setDownloadRoot(String downloadRoot) {
        this.downloadRoot = downloadRoot;
    }

    public String getUploadAcctContractPath() {
        return uploadAcctContractPath;
    }

    public void setUploadAcctContractPath(String uploadAcctContractPath) {
        this.uploadAcctContractPath = uploadAcctContractPath;
    }

    public String getUploadOperatorInvoicePath() {
        return uploadOperatorInvoicePath;
    }

    public void setUploadOperatorInvoicePath(String uploadOperatorInvoicePath) {
        this.uploadOperatorInvoicePath = uploadOperatorInvoicePath;
    }
}
